home *** CD-ROM | disk | FTP | other *** search
/ Champak 130 / Vol 130.iso / games / tom.swf / scripts / classes / game / GameOver.as < prev    next >
Encoding:
Text File  |  2011-04-12  |  1.3 KB  |  55 lines

  1. package classes.game
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.events.Event;
  5.    import flash.net.LocalConnection;
  6.    
  7.    [Embed(source="/_assets/assets.swf", symbol="classes.game.GameOver")]
  8.    public class GameOver extends MovieClip
  9.    {
  10.        
  11.       
  12.       private var str:String;
  13.       
  14.       private var score:int;
  15.       
  16.       private var vFrm:int;
  17.       
  18.       public var Score:classes.game.Score;
  19.       
  20.       public function GameOver(param1:int)
  21.       {
  22.          super();
  23.          addFrameScript(79,frame80);
  24.          score = param1;
  25.          this.gotoAndStop("view");
  26.          vFrm = this.currentFrame;
  27.          this.gotoAndPlay(1);
  28.          this.addEventListener(Event.ENTER_FRAME,checkFrm);
  29.          str = String(score);
  30.       }
  31.       
  32.       private function checkFrm(param1:Event) : void
  33.       {
  34.          if(this.currentFrame == vFrm)
  35.          {
  36.             this.removeEventListener(Event.ENTER_FRAME,checkFrm);
  37.             viewScore();
  38.          }
  39.       }
  40.       
  41.       internal function frame80() : *
  42.       {
  43.          this.stop();
  44.       }
  45.       
  46.       public function viewScore() : void
  47.       {
  48.          this.Score.setScore(score);
  49.          var _loc1_:LocalConnection = new LocalConnection();
  50.          _loc1_.send("_user","fnPostScore",int(str));
  51.          trace(int(str));
  52.       }
  53.    }
  54. }
  55.